package com.chen.demo02;

public class UserServiceProxy implements UserService{
    private UserServiceImpl userService;

    public void setUserService(UserServiceImpl userService) {
        this.userService = userService;
    }

    @Override
    public void add() {
        log("add");
        userService.add();
    }

    @Override
    public void update() {
       log("update");
       userService.update();
    }

    @Override
    public void select() {
         log("select");
         userService.select();
    }

    @Override
    public void delete() {
         log("delete");
         userService.delete();
    }

    public void log(String msg){
        System.out.println("[debug]打印"+msg+"日志");
    }
}
